package org.dydl.dao.system.repository;

import org.dydl.model.system.SysCustomer;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.query.Param;

public interface ISysCustomerRepository extends CrudRepository<SysCustomer, Integer>, JpaSpecificationExecutor<SysCustomer> {

	@Query(value = "FROM SysCustomer sy",countQuery = "SELECT count(sy.id) FROM SysCustomer sy")
	public Page<SysCustomer> getSysCustomerList(Pageable pageable);
	
	
	@Query(value = " FROM SysCustomer sy WHERE sy.customerFullName LIKE :fullName", countQuery = "SELECT count(sy.id) FROM SysCustomer sy WHERE sy.customerFullName LIKE :fullName")
	public Page<SysCustomer> getSysCustomerListLike(@Param("fullName") String fullName, Pageable pageable);
}
